<div id="post_wall" style="padding-top: 8px;padding-bottom:10px">
    <a id="link2" class="active" href="#">DE QUOI VOUS-PENSEZ ?</a> &nbsp;<a id="link1" href="#" >ENVOYER PHOTO</a>
    <div id="photo_upload" style="display: none;">
        <?php 
            $attributes = array('class' => 'upload_image', 'id' => 'upload_image');
            echo form_open_multipart('image/upload_image', $attributes);
        ?>
        <table>
            <tr>
                <td><label for="image_upload">Photo : </label></td>
                <td><input type="file" name="userfile" size="20" /></td>
            </tr>
            <tr>
                <td><label for="image_title">Nom de la photo :</label></td>
                <td><input type="text" name="image_title" id="image_title" size="35"/></td>
            </tr>
            <tr>
               <td></td> <td colspan="2"><input type="submit" name="submit_upload_image" id="submit_upload_image" value="Envoyer"/></td>
            </tr>
        </table>
        
        </form>
    </div>
    <div class="wall_sms">
    <?php echo form_open('message/send_wall_message'); ?>
    <table>
       <tr><td> <textarea name="wall_message" style="overflow:visible;" cols="45" rows="1"></textarea></td>
   <td> <input type="submit" name="submit" value="Partager"/></td></tr>
    </table>
    <?php echo form_error('wall_message')?>
    <?php echo form_close(); ?>
    </div>
</div>
<?php foreach ($wall_messages as $wall_message) :?>
    <?php
        $post_date = $wall_message['posted_time'];
        $now = time(); 
        $time_posted_calculate = timespan($post_date, $now);
    ?>
    <?php
        $image_ava = './doggy_avatar/images/' . $wall_message['avatar'];
        if(file_exists($image_ava) && $wall_message['avatar'] != null){
            $image_ava = base_url() . 'doggy_avatar/images/' . $wall_message['avatar'];
        } else{
            $image_ava = root_url('doggy-flirt') .'./assets/noimage.gif';
    }?>
    <div style="margin: 0 auto; width: 480px; margin-top: 5px;">
        <table width="100%" class="list">
            <tr>
                <td width="10%" valign="top"><a href="<?php echo site_url('home/compte/'.$wall_message['posted_by'])?>"><img src="<?php echo $image_ava;?>" width="50" border="0"></a></td>
                <td align="left" valign="top">
                    <a href="<?php echo site_url('home/compte/'.$wall_message['posted_by']);?>" class="account_link"><?php echo  $wall_message['display_name'];?>
                    </a>
                    <?php if($wall_message['post_to']!=null){?>
                    <?php if($wall_message['post_to']==$this->_data['account_id']){?>
                        <a href="<?php echo site_url('home/delete_wall_message'.'/'.$wall_message['id'].'/'.$wall_message['post_to'].'/1')?>"><img align="right" alt="" src="<?php echo base_url().'assets/css/images/delete.png';?>" border="0" /></a>
                    <?php }?>
                    a publié sur le mur de <a href="<?php echo site_url('home/compte/'.$wall_message['post_to']);?>" class="account_link"><span class="account_link"><?php echo get_display_name($wall_message['post_to'])?></span></a>
                    <?php }else{?>
                    <?php if($wall_message['posted_by']==$this->_data['account_id']){?>
                        <a href="<?php echo site_url('home/delete_wall_message'.'/'.$wall_message['id'].'/'.$wall_message['posted_by'].'/1')?>"><img align="right" alt="" src="<?php echo base_url().'assets/css/images/delete.png';?>" border="0" /></a>
                    <?php }?>
                    <?php }?>
                    <p style="color: #886525;"><?php echo $wall_message['content'];?></p>
                    <?php if($wall_message['image']!=NULL){?>
                        
                       <a id="example5" href="<?php echo base_url().'upload_photo/'.$wall_message['image'];?>" title="">
                        <img alt="" src="<?php echo base_url().'upload_photo/thumbs/'.$wall_message['image'];?>" width="121px" border="0" />
                       </a>
                        <?php }?>
                    <p style="color: blue;">Il y a <?php echo $time_posted_calculate;?></p>
                </td>
            </tr>
        </table>
	</div>

    <?php endforeach;?>
    <div align="center"><font color="#5d94c5" style="font-size: normal;"><?php echo $pagination;?></font></div>